package dto_objects;

import java.util.List;

public class BookDTO {
	private int ISBN, oldISBN;
	private PublisherDTO publisher;
	private List<AuthorDTO> authors;
	private List<SubjectDTO> subjects;
	private String title;
	private int pages;
	private int bookID;
	private String status;
	
	public BookDTO(int ISBN, int bookID, String status){
		this.ISBN = ISBN;
		this.bookID = bookID;
		this.status = status;
	}
	
	public BookDTO(int ISBN, PublisherDTO publisher, List<AuthorDTO> authors, List<SubjectDTO> subjects, String title, int pages){
		this.oldISBN = ISBN;
		this.ISBN = ISBN;
		this.publisher = publisher;
		this.authors = authors;
		this.subjects = subjects;
		this.title = title;
		this.pages = pages;
	}
	

	public BookDTO(int ISBN, PublisherDTO publisher, String title, int pages){
		this.oldISBN = ISBN;
		this.ISBN = ISBN;
		this.publisher = publisher;
		this.title = title;
		this.pages = pages;
	}

	public int getISBN() {
		return ISBN;
	}
	
	public int getOldISBN() {
		return oldISBN;
	}
	
	public String getStatus() {
		return status;
	}
	
	public void setStatus(String status) {
		this.status = status;
	}

	public void setISBN(int iSBN) {
		ISBN = iSBN;
	}

	public PublisherDTO getPublisher() {
		return publisher;
	}

	public void setPublisher(PublisherDTO publisher) {
		this.publisher = publisher;
	}

	public List<AuthorDTO> getAuthors() {
		return authors;
	}

	public void setAuthors(List<AuthorDTO> authors) {
		this.authors = authors;
	}

	public List<SubjectDTO> getSubjects() {
		return subjects;
	}
	
	public String getAuthorNames(){
		String temp = "";
		for (int i = 0; i < authors.size() ; i++) {
			temp = temp + authors.get(i).getAuthorFirstName() +" "+ authors.get(i).getAuthorLastName();
			if(i != authors.size() - 1)
				temp = temp + ", ";
		}
		return temp;
	}
	
	public String getSubjectNames(){
		String temp = "";
		for (int i = 0; i < subjects.size() ; i++) {
			temp = temp + subjects.get(i).getSubject_name();
			if(i != subjects.size() - 1)
				temp = temp + ", ";
		}
		return temp;
	}

	public void setSubjects(List<SubjectDTO> subjects) {
		this.subjects = subjects;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getPages() {
		return pages;
	}

	public void setPages(int pages) {
		this.pages = pages;
	}

	public int getBookID() {
		return bookID;
	}

	public void setBookID(int bookID) {
		this.bookID = bookID;
	}
	
}
